package org.testfire.realm.model.entities.testfire;

import javax.persistence.*;

/**
 * Created by IntelliJ IDEA.
 * User: granum
 * Date: Sep 11, 2007
 * Time: 9:16:40 PM
 */
@Entity
@Table(catalog = "testfire", name = "test_result")
public class TestResultsEntity
{
	private Integer id;
	private Integer statuscode;
	private Integer runDuration;
	private String errorMessage;
	private String errorTrace;
	private TestEntity test;
	private TestsetResultEntity testsetResult;

	@ManyToOne
	@JoinColumn(name = "testset_result_id", referencedColumnName = "id", nullable = false)
	public TestsetResultEntity getTestsetResult()
	{
		return testsetResult;
	}

	public void setTestsetResult(TestsetResultEntity testsetResult)
	{
		this.testsetResult = testsetResult;
	}

	@ManyToOne
	@JoinColumn(name = "test_id", referencedColumnName = "id", nullable = false)
	public TestEntity getTest()
	{
		return test;
	}

	public void setTest(TestEntity test)
	{
		this.test = test;
	}

	@Basic
	@Column(name = "error_trace", nullable = false, length = 65535)
	public String getErrorTrace()
	{
		return errorTrace;
	}

	public void setErrorTrace(String errorTrace)
	{
		this.errorTrace = errorTrace;
	}

	@Basic
	@Column(name = "error_message", nullable = false)
	public String getErrorMessage()
	{
		return errorMessage;
	}

	public void setErrorMessage(String errorMessage)
	{
		this.errorMessage = errorMessage;
	}

	@Basic
	@Column(name = "run_duration", nullable = false, length = 10)
	public Integer getRunDuration()
	{
		return runDuration;
	}

	public void setRunDuration(Integer runDuration)
	{
		this.runDuration = runDuration;
	}

	@Basic
	@Column(name = "statuscode", nullable = false, length = 10)
	public Integer getStatuscode()
	{
		return statuscode;
	}

	public void setStatuscode(Integer statuscode)
	{
		this.statuscode = statuscode;
	}

	@Id
	@Column(name = "id", nullable = false, length = 10)
	public Integer getId()
	{
		return id;
	}

	public void setId(Integer id)
	{
		this.id = id;
	}
}
